package com.eliza.base.viewrouter

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.ExitToApp
import androidx.compose.material.icons.automirrored.rounded.List
import androidx.compose.material.icons.automirrored.rounded.Send
import androidx.compose.material.icons.rounded.AccountBox
import androidx.compose.material.icons.rounded.Add
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.composable
import androidx.navigation.compose.navigation
import com.eliza.base.views.device.bluetooth.compose.BlueToothHomeScreen
import com.eliza.base.views.device.info.DeviceInfoScreen
import com.eliza.base.views.device.nfc.DeviceNFCScreen
import com.eliza.base.views.device.position.PositionScreen
import com.eliza.base.views.device.usb.DeviceUsbScreen
import com.eliza.base.views.device.vpn.DeviceVpnScreen
import com.eliza.base.views.device.wifi.DeviceWifiScreen
import com.eliza.library.ui.inter.IBaseRoute
import com.eliza.library.ui.inter.INavScreen

enum class NavDeviceEnum(
    override val title: String,
    override val imageVector: ImageVector,
    override val content: @Composable (NavController) -> Unit
) : IBaseRoute {
    USB("USB", Icons.AutoMirrored.Rounded.Send, { DeviceUsbScreen(it) }),
    VPN(
        "VPN",
        Icons.Rounded.AccountBox,
        { DeviceVpnScreen(it) }),
    WIFI("WIFI", Icons.Rounded.Add, { DeviceWifiScreen(it) }),
    BLUETOOTH("BLUETOOTH",
        Icons.AutoMirrored.Rounded.Send,
        { BlueToothHomeScreen() }),
    Product("DeviceInfo", Icons.AutoMirrored.Rounded.List, { DeviceInfoScreen(it) }),
    NFC("NFC", Icons.AutoMirrored.Rounded.List, { DeviceNFCScreen(it) }),
    Camera("Camera", Icons.AutoMirrored.Rounded.ExitToApp, {
        com.eliza.base.views.device.camera.CameraX.Show()
    }),
    Position("Position", Icons.AutoMirrored.Rounded.List, { PositionScreen(it) });

    companion object : INavScreen {
        override fun RegisterRoute(navController: NavHostController,nav: NavGraphBuilder) {
            nav.navigation(
                startDestination = USB.title, route = "NavDeviceEnum"
            ) {
                NavDeviceEnum.entries.forEach { route ->
                    // 显示添加导航参数 (参数列表)
                    composable(route.title) {
                        route.content(navController)
                    }
                }
            }
        }
    }

}

